home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsIChannelEventSink.idl < prev    next >
Text File  |  2006-05-08  |  4KB  |  104 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* vim:set ts=4 sw=4 sts=4 cin: */
  3. /* ***** BEGIN LICENSE BLOCK *****
  4.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5.  *
  6.  * The contents of this file are subject to the Mozilla Public License Version
  7.  * 1.1 (the "License"); you may not use this file except in compliance with
  8.  * the License. You may obtain a copy of the License at
  9.  * http://www.mozilla.org/MPL/
  10.  *
  11.  * Software distributed under the License is distributed on an "AS IS" basis,
  12.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13.  * for the specific language governing rights and limitations under the
  14.  * License.
  15.  *
  16.  * The Original Code is Mozilla.
  17.  *
  18.  * The Initial Developer of the Original Code is
  19.  * Netscape Communications.
  20.  * Portions created by the Initial Developer are Copyright (C) 2001
  21.  * the Initial Developer. All Rights Reserved.
  22.  *
  23.  * Contributor(s):
  24.  *   Gagan Saksena <gagan@netscape.com> (original author)
  25.  *   Darin Fisher <darin@netscape.com>
  26.  *   Christian Biesinger <cbiesinger@web.de>
  27.  *
  28.  * Alternatively, the contents of this file may be used under the terms of
  29.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  30.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  31.  * in which case the provisions of the GPL or the LGPL are applicable instead
  32.  * of those above. If you wish to allow use of your version of this file only
  33.  * under the terms of either the GPL or the LGPL, and not to allow others to
  34.  * use your version of this file under the terms of the MPL, indicate your
  35.  * decision by deleting the provisions above and replace them with the notice
  36.  * and other provisions required by the GPL or the LGPL. If you do not delete
  37.  * the provisions above, a recipient may use your version of this file under
  38.  * the terms of any one of the MPL, the GPL or the LGPL.
  39.  *
  40.  * ***** END LICENSE BLOCK ***** */
  41.  
  42. #include "nsISupports.idl"
  43.  
  44. interface nsIChannel;
  45.  
  46. /**
  47.  * Implement this interface to receive control over various channel events.
  48.  * Channels will try to get this interface from a channel's
  49.  * notificationCallbacks or, if not available there, from the loadGroup's
  50.  * notificationCallbacks.
  51.  *
  52.  * These methods are called before onStartRequest, and should be handled
  53.  * SYNCHRONOUSLY.
  54.  */
  55. [scriptable, uuid(6757d790-2916-498e-aaca-6b668a956875)]
  56. interface nsIChannelEventSink : nsISupports
  57. {
  58.     /**
  59.      * This is a temporary redirect. New requests for this resource should
  60.      * continue to use the URI of the old channel.
  61.      *
  62.      * The new URI may be identical to the old one.
  63.      */
  64.     const unsigned long REDIRECT_TEMPORARY = 1 << 0;
  65.  
  66.     /**
  67.      * This is a permanent redirect. New requests for this resource should use
  68.      * the URI of the new channel (This might be an HTTP 301 reponse).
  69.      * If this flag is not set, this is a temporary redirect.
  70.      *
  71.      * The new URI may be identical to the old one.
  72.      */
  73.     const unsigned long REDIRECT_PERMANENT = 1 << 1;
  74.  
  75.     /**
  76.      * This is an internal redirect, i.e. it was not initiated by the remote
  77.      * server, but is specific to the channel implementation.
  78.      *
  79.      * The new URI may be identical to the old one.
  80.      */
  81.     const unsigned long REDIRECT_INTERNAL = 1 << 2;
  82.  
  83.     /**
  84.      * Called when a redirect occurs. This may happen due to an HTTP 3xx status
  85.      * code.
  86.      *
  87.      * @param oldChannel
  88.      *        The channel that's being redirected.
  89.      * @param newChannel
  90.      *        The new channel. This channel is not opened yet.
  91.      * @param flags
  92.      *        Flags indicating the type of redirect. A bitmask consisting
  93.      *        of flags from above.
  94.      *        One of REDIRECT_TEMPORARY and REDIRECT_PERMANENT will always be
  95.      *        set.
  96.      *
  97.      * @throw <any> Throwing an exception will cancel the load. No network
  98.      * request for the new channel will be made.
  99.      */
  100.     void onChannelRedirect(in nsIChannel oldChannel, 
  101.                            in nsIChannel newChannel,
  102.                            in unsigned long flags);
  103. };
  104.